<%@page  import="Model.*" %>
<%@page  import="ActionForm.SearchProForm" %>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<style type="text/css">
<!--
.style3 {font-size: 18px; font-style: italic; color: #FF66FF;}

a:hover,img:hover {font-weight:bold; cursor:pointer}
.style9 {
	color: #006464;
	font-size: 18px;
}


-->
</style>

<% SearchProForm spf=new SearchProForm();
        if(session.getAttribute("SearchProForm")!=null)
              spf = (SearchProForm)session.getAttribute("SearchProForm");
        if(spf.getAmount()==null || spf.getAmount().trim()=="")
        {
              spf.setCat("-1");
              spf.setAmount("8");
              spf.setGender("-1");
              spf.setMaxSize("-1");
              spf.setMinSize("-1");
              spf.setPage("1");
              }
           %>
       <html:form action="/client/pages/product" >
           <html:hidden property="minSize" name="SearchProForm" value="<%=spf.getMinSize()%>" />
           <html:hidden property="maxSize" name="SearchProForm" value="<%=spf.getMaxSize()%>" />
           <html:hidden property="cat" name="SearchProForm" value="<%=spf.getCat()%>" />
           <html:hidden property="gender" name="SearchProForm" value="<%=spf.getGender()%>" />
           <html:hidden property="page" name="SearchProForm" value="<%=spf.getPage()%>" />
           <html:hidden property="amount" name="SearchProForm" value="<%=spf.getAmount()%>" />
       </html:form>

<table width="100%"  cellpadding="0px">
  <tr>
    <td colspan="2"><table width="100%" cellspacing="0">
      <tr>
        <td colspan="2" align="center" class="style3"><u>Baby</u></td>
      </tr>
      <tr bgcolor="#E1ECEB">
        <td align="center" style="border-right:2px solid  #F4F4F4">
            <img <% if(spf.getGender().compareToIgnoreCase("1")==0) out.print("width=\"65px\" height=\"60px\"")
                    ; else out.print("width=\"45\" height=\"40\""); %> src="../picture/boy.jpg" alt="Be trai"   title="Be trai" onclick="sexClick('1')" />
        </td>
        <td align="center">
            <img <% if(spf.getGender().compareToIgnoreCase("0")==0) out.print("width=\"65px\" height=\"60px\"");
             else out.print("width=\"45\" height=\"40\"");%> src="../picture/girl.jpg" alt="Be gai" width="55" height="50" title="Be gai" onclick="sexClick('0')" />
       </td>
      </tr>
      <tr bgcolor="#E1ECEB" >
          <td colspan="2" onclick="sexClick('-1')" align="center" style="border-top:2px solid  #F4F4F4;" >
              <a <% if(spf.getGender().compareToIgnoreCase("-1")==-0) out.print("style = \" font-weight: bolder ;font-size:22px\""); %> > All </a></td>
      </tr>
      <tr>
        <td colspan="2"><table width="100%" cellpadding="0" cellspacing="0">
                <tr><td style="font-size: 22" align="center"> Size </td></tr>

                <% int maxsize = ProModel.getMaxSize();
       if(maxsize>-1)
        {
           if(maxsize%2 !=0)
               maxsize += 1;
           int i=1;
           while(i<maxsize)
               {



    %>
          <tr>
            <td align="center" id="size">

                <a> <span class="style9" onclick="sizeClick(<%=i%>)" <% if(spf.getMinSize().equals(i+"")) out.print("style=\"font-weight:bolder;font-size:22px\""); %>>
                        <%=i%> - <%=i+1%></span>&nbsp; </a>
            </td>
          </tr>
          <% i += 2;} %>
          <tr><td align="center" class="style9" onclick="sizeClick(<%=-1%>)">
                  <a  <% if(spf.getMinSize().equals("-1")) out.print("style=\"font-weight:bolder;font-size:22px\""); %>> All </a> </td></tr>
          <%
       } %>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td colspan="2" align="center" class="style3"><u class="style3">Th&#7901;i trang c&#7911;a b&eacute; </u></td>
  </tr>
  <tr>
    <td width="50%" height="24" align="right" class="style9" style="border-right:#CCCCCC solid 2px">
        <a onclick="catClick('3')"  <% if(spf.getCat().equals("3")) out.print("style=\"font-weight:bolder;font-size:22px\""); %>>Qu&#7847;n&nbsp;&nbsp;</a></td>
    <td width="50%" align="left" class="style9">
        <a onclick="catClick('2')" <% if(spf.getCat().equals("2")) out.print("style=\"font-weight:bolder;font-size:22px\""); %>>&nbsp;&nbsp;&Aacute;o</a></td>
  </tr>
  <tr>
    <td height="25" colspan="2" align="center" class="style9">
        <a onclick="catClick('1')" <% if(spf.getCat().equals("1")) out.print("style=\"font-weight:bolder;font-size:22px\""); %>>B&#7897;&nbsp;</a></td>
  </tr>
  <tr>
    <td height="31" colspan="2" align="center" class="style9">
        <a onclick="catClick('4')" <% if(spf.getCat().equals("4")) out.print("style=\"font-weight:bolder;font-size:22px\""); %>>V&aacute;y&nbsp;</a></td>
  </tr>
  <tr>
      <td height="31" colspan="2" align="center" class="style9">
        <a onclick="catClick('-1')" <% if(spf.getCat().equals("-1")) out.print("style=\"font-weight:bolder;font-size:22px\""); %>>All</a></td>
  </tr>
</table>

        
       
<script>
           function sizeClick(i)
           {
             
               document.forms[0].minSize.value=i+"";
               i=i+1;
               document.forms[0].maxSize.value=i+"";
               document.forms[0].submit();
           }
           function sexClick(sex)
           {
               document.forms[0].gender.value = sex;
               document.forms[0].submit();
           }
           function catClick(cat)
           {
               document.forms[0].cat.value=cat;
               document.forms[0].submit();
           }
       </script>
